package com.lakeworks.utils;

import com.lakeworks.common.core.page.PageParams;

public class NoCountPageUtil {

    public static Integer getTotal (Integer listSize, PageParams para) {
        Integer total = 0;
        if (listSize == para.getPageSize()) {
            total = para.getPageNum() * para.getPageSize() + 1;
        } else {
            if (para.getPageNum() > 1) {
                if (listSize > 0) {
                    total = (para.getPageNum() - 1) * para.getPageSize() + listSize;
                } else {
                    total = -1;
                }
            } else {
                total = listSize;
            }
        }
        return total;
    }
}
